pvalue<-pt(t0,floor(v))
criticalregion<-c(t.alpha,-t.alpha)
cat("The test statistic is: ", t0)
# perform chi-square test on the data table
chisq.test(tbl,correct=FALSE)
setwd("~/")
xbar2<-mean(toyota$weight)
cat("The test statistic is: ", t0)
cat("The test statistic is: ", t0)
v<-((s1^2/n1)+(s2^2/n2))^2/(((s1^2/n1)^2/(n1-1))+((s2^2/n2)^2/(n2-1)))
t0<-(xbar1-xbar2-0)/(sqrt((s1^2/n1)+(s2^2/n2)))
pvalue<-pt(t0,floor(v))
#assume alpha=0.05
alpha<-0.05
t.alpha = qt(alpha/2,floor(v))
criticalregion<-c(t.alpha,-t.alpha)
toyota <- read_excel("AutoData.xlsx", sheet = "HT2", range = "D1:E33")
cat("The test statistic is: ", t0)
cat("The P-value is: ", pvalue)
cat("The critical value is: ", t.alpha)
cat("The critical region is: ", criticalregion)
9i
cat("The critical value is: ", t.alpha)
12
1=2
1+2
t.alpha
t
criticalregion
pvalue
hondanissan <- read_excel("AutoData.xlsx", sheet = "HT2", range = "A1:B32")
alpha<-0.05
t.alpha = qt(alpha/2,floor(v))
setwd("C:/Users/acer/Desktop/Project2 R Dataset")
library(readxl)
appletoshiba <- read_excel("laptops.xlsx", sheet = "HT2", range = "A1:B70")
msi <- read_excel("laptops.xlsx", sheet = "HT2", range = "D1:E55")
xbar1<-mean(appletoshiba$weight)
xbar2<-mean(msi$weight)
s1<-sd(appletoshiba$weight)
s2<-sd(msi$weight)
n1<-nrow(appletoshiba)
n2<-nrow(msi)
v<-((s1^2/n1)+(s2^2/n2))^2/(((s1^2/n1)^2/(n1-1))+((s2^2/n2)^2/(n2-1)))
t0<-(xbar1-xbar2-0)/(sqrt((s1^2/n1)+(s2^2/n2)))
pvalue<-pt(t0,floor(v))
#assume alpha=0.05
alpha<-0.05
t.alpha = qt(alpha/2,floor(v))
criticalregion<-c(t.alpha,-t.alpha)
cat("The test statistic is: ", t0)
cat("The P-value is: ", pvalue)
cat("The critical value is: ", t.alpha)
cat("The critical region is: ", criticalregion)
library(readxl)
msi <- read_excel("laptops.xlsx", sheet = "CR", range = "A1:C55")
x<-c(msi$weight)
y<-c(msi$ram)
plot(x,y,main = "Relationship between Weight and Ram of MSI Laptops",xlim=c(1.0,5.5),ylim=c(5,25),xlab="Weight",ylab="Ram")
abline(lm(y ~ x))
cor.test(x,y)
library(readxl)
appletoshiba <- read_excel("laptops.xlsx", sheet = "HT2", range = "A1:B70")
msi <- read_excel("laptops.xlsx", sheet = "HT2", range = "D1:E55")
xbar1<-mean(appletoshiba$weight)
xbar2<-mean(msi$weight)
s1<-sd(appletoshiba$weight)
s2<-sd(msi$weight)
n1<-nrow(appletoshiba)
n2<-nrow(msi)
v<-((s1^2/n1)+(s2^2/n2))^2/(((s1^2/n1)^2/(n1-1))+((s2^2/n2)^2/(n2-1)))
t0<-(xbar1-xbar2-0)/(sqrt((s1^2/n1)+(s2^2/n2)))
pvalue<-pt(t0,floor(v))
#assume alpha=0.05
alpha<-0.05
t.alpha = qt(alpha/2,floor(v))
criticalregion<-c(t.alpha,-t.alpha)
cat("The test statistic is: ", t0)
cat("The P-value is: ", pvalue)
cat("The critical value is: ", t.alpha)
cat("The critical region is: ", criticalregion)
library(readxl)
msi <- read_excel("laptops.xlsx", sheet = "CR", range = "A1:C55")
x<-c(msi$weight)
y<-c(msi$ram)
plot(x,y,main = "Relationship between Weight and Ram of MSI Laptops",xlim=c(1.0,5.5),ylim=c(5,25),xlab="Weight",ylab="Ram")
abline(lm(y ~ x))
cor.test(x,y)
library(readxl)
msi <- read_excel("laptops.xlsx", sheet = "CR", range = "A1:C55")
x<-c(msi$weight)
y<-c(msi$ram)
plot(x,y,main = "Relationship between Weight and Ram of MSI Laptops",xlim=c(1.0,5.5),ylim=c(5,25),xlab="Weight",ylab="Ram")
abline(lm(y ~ x))
(lm(y ~ x))
summary(lm(y ~ x))
library(readxl)
laptops <- read_excel("laptops.xlsx", sheet = "ANOVA")
res.aov <- aov(inches ~ brand, data = laptops)
summary(res.aov)
